package com.lcm.basic.p7.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author Coder-lcm
 * @date 2021/4/3
 *
 *  Iterator：　迭代器
 */
public class IteratorDemo {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add("Dsadad");
        c.add(2133);
        c.add(Boolean.TRUE);
        Iterator iterator = c.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
